<script lang="ts">
import Vue from 'vue'

export default Vue.extend({
  name: "Student",
  data() {
    console.log(this)
    return {
      msg: '我正在学习Vue'
    }
  },
  props: {
    sex: {
      type: String,
      default: '男'//默认值
    },
    name: {
      type: String,
      required: true//必传
    },
    age: {
      type: Number,
      default: 18
    }
  }
})
</script>

<template>
  <div class="demo">
    <h1>{{ msg }}</h1>
    <h2>学生姓名: {{ name }}</h2>
    <h2>学生性别: {{ sex }}</h2>
    <h2>学生年龄: {{ age }}</h2>
  </div>
</template>

<style scoped>
.demo {
  background-color: skyblue;
}
</style>